import { PureComponent, createRef } from "react"
import VirtualFnDOM from "./components/函数组件没有实例怎么绑定"
export default class Page2 extends PureComponent {
  constructor() {
    super()
    this.VirtualFnDOM = createRef()
  }
  getVirtualFnDOMRef() {
    console.log(this.VirtualFnDOM.current)
  }
  render() {
    return (
      <>
        <h2>page2</h2>
        <VirtualFnDOM ref={this.VirtualFnDOM} />
        <button onClick={() => this.getVirtualFnDOMRef()}>
          获取子组件(函数组件)
        </button>
      </>
    )
  }
}
